package com.ebring.shareEducation.service.impl;

import com.ebring.shareEducation.bean.UserTalent;
import com.ebring.shareEducation.dao.UserTalentMapper;
import com.ebring.shareEducation.service.UserTalentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;

@Service
@Transactional
public class UserTalentServiceImpl implements UserTalentService {
    @Autowired
    private UserTalentMapper userTalentMapper;

    @Override
    public int insertUserTalent(UserTalent userTalent) {
        return userTalentMapper.insert(userTalent);
    }

    @Override
    public int selectUserTalent(String userId, String talentId) {
        Example example = new Example(UserTalent.class);
        example.or().andEqualTo("userId",userId).andEqualTo("talentId",talentId);
        return userTalentMapper.selectCountByExample(example);
    }
}
